/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.jhelper.unit06.demo;

import java.util.Enumeration;
import java.util.Hashtable;

/**
 *
 * @author Administrator
 */
public class MapDemo1 {
    
    
    public static void main(String[] args) {
        
        // Hashtable 
        // HashMap
        
        
//        Integer i = new Integer(10);
//       
//        i.intValue();
        
        Hashtable s = new Hashtable();
        s.put("john", new Integer(90));
        s.put("令狐冲", new Integer(100));
        s.put("ale", new Integer(50));
        
        System.out.println("hashtable的内容是：");
        System.out.println(s);
        
        
        Enumeration e = s.elements();
        while(e.hasMoreElements()){
            Integer tmp = (Integer) e.nextElement();
            System.out.print(tmp.intValue() + " ");
        }
        
        System.out.print("john的成绩是：");
        System.out.println(s.get("john"));
        if(s.containsValue(90)){
            System.out.println("yes!");
        }else{
            System.out.println("查无此人");
        }
    }

}
